-
Notifications
You must be signed in to change notification settings - Fork 10
Jm test1 - Is dev any different? #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jeremymoskowitz-netwrix
wants to merge
4
commits into
dev
Choose a base branch
from
JM-TEST1
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…er docs Changed "Windows 10" to "Windows" in remoteworkdelivery section to keep messaging simple and future-proof. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Comment on lines
+21
to
+36
runs-on: ubuntu-latest | ||
outputs: | ||
environment: ${{ steps.set-env.outputs.environment }} | ||
steps: | ||
- name: Determine environment | ||
id: set-env | ||
run: | | ||
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | ||
echo "environment=${{ github.event.inputs.environment }}" >> $GITHUB_OUTPUT | ||
elif [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | ||
echo "environment=production" >> $GITHUB_OUTPUT | ||
else | ||
echo "environment=development" >> $GITHUB_OUTPUT | ||
fi | ||
|
||
build: |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Comment on lines
+101
to
+202
environment: ${{ needs.determine-environment.outputs.environment }} | ||
|
||
steps: | ||
- name: Download build artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: build-output | ||
path: build/ | ||
|
||
- name: Install azcopy | ||
run: | | ||
wget -O azcopy.tar.gz https://aka.ms/downloadazcopy-v10-linux | ||
tar -xf azcopy.tar.gz --strip-components=1 | ||
sudo mv azcopy /usr/local/bin/ | ||
azcopy --version | ||
|
||
- name: Install Azure CLI | ||
run: | | ||
if ! command -v az &> /dev/null; then | ||
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash | ||
fi | ||
az version | ||
|
||
- name: Upload to Azure Blob Storage with AzCopy and comprehensive MIME types | ||
run: | | ||
echo "Deploying to ${{ needs.determine-environment.outputs.environment }} environment" | ||
echo "Starting high-performance sync of changed files with proper MIME types..." | ||
|
||
# Create SAS token for azcopy (using account key) | ||
end_date=$(date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ') | ||
sas_token=$(az storage container generate-sas \ | ||
--account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} \ | ||
--account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} \ | ||
--name '$web' \ | ||
--permissions dlrw \ | ||
--expiry $end_date \ | ||
--output tsv) | ||
|
||
azcopy sync "./build/" \ | ||
"https://${{ secrets.STORAGE_ACCOUNT_NAME }}.blob.core.windows.net/\$web?$sas_token" \ | ||
--delete-destination=true \ | ||
--compare-hash=MD5 \ | ||
--log-level=INFO \ | ||
--cap-mbps=0 \ | ||
--block-size-mb=4 | ||
|
||
echo "Sync completed!" | ||
|
||
- name: Set MIME types for all file types | ||
run: | | ||
echo "Setting MIME types for all file types..." | ||
|
||
# Web files | ||
echo "Setting MIME types for web files..." | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.css" --content-type "text/css" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.js" --content-type "application/javascript" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.mjs" --content-type "application/javascript" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.json" --content-type "application/json" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.html" --content-type "text/html" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.htm" --content-type "text/html" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.xml" --content-type "application/xml" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.txt" --content-type "text/plain" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
|
||
# Images | ||
echo "Setting MIME types for images..." | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.png" --content-type "image/png" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.jpg" --content-type "image/jpeg" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.jpeg" --content-type "image/jpeg" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.gif" --content-type "image/gif" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.webp" --content-type "image/webp" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.svg" --content-type "image/svg+xml" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.ico" --content-type "image/x-icon" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
|
||
# Fonts | ||
echo "Setting MIME types for fonts..." | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.woff" --content-type "font/woff" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.woff2" --content-type "font/woff2" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.ttf" --content-type "font/ttf" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
az storage blob update-batch --account-name ${{ secrets.STORAGE_ACCOUNT_NAME }} --account-key ${{ secrets.STORAGE_ACCOUNT_KEY }} --source '$web' --pattern "*.otf" --content-type "font/otf" --if-unmodified-since "1970-01-01T00:00:00Z" --no-progress || true | ||
|
||
echo "All MIME types set successfully!" | ||
|
||
- name: Purge CDN endpoint (if configured) | ||
run: | | ||
if [[ -n "${{ secrets.CDN_ENDPOINT_NAME }}" ]] && [[ -n "${{ secrets.CDN_PROFILE_NAME }}" ]] && [[ -n "${{ secrets.CDN_RESOURCE_GROUP }}" ]]; then | ||
echo "Note: CDN purge requires Azure login. Skipping CDN purge when using storage key authentication." | ||
echo "To use CDN purge, you'll need to use Azure AD authentication or purge CDN manually." | ||
else | ||
echo "CDN configuration not found, skipping CDN purge." | ||
fi | ||
|
||
- name: Display deployment URL | ||
run: | | ||
echo "🚀 Deployment complete!" | ||
echo "Environment: ${{ needs.determine-environment.outputs.environment }}" | ||
echo "URL: https://${{ secrets.STORAGE_ACCOUNT_NAME }}.z13.web.core.windows.net" | ||
if [[ -n "${{ secrets.CUSTOM_DOMAIN }}" ]]; then | ||
echo "Custom Domain: ${{ secrets.CUSTOM_DOMAIN }}" | ||
fi | ||
echo "All files deployed with proper MIME types for optimal browser compatibility!" |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Jm test1 - Is dev any different?